#define _CRT_SECURE_NO_WARNINGS
#define N 106
#include<stdio.h>
int main()
{
	int n, m;
	int a, b, c, sum = 0, flag1 = 0, flag2 = 0;
	scanf("%d%d", &n, &m);
	for (int i = n; i <= m; i++)
	{
		a = i / 100;
		b = i % 100 / 10;
		c = i % 10;
		if (a * a * a + b * b * b + c * c * c == i&&flag1 == 0)
		{
			printf("%d", i);
			flag1 = flag2 = 1;
		}
		else if (a * a * a + b * b * b + c * c * c == i)
		{
			printf(" %d", i);
		}
	}
	if(flag2==0) printf("-1");
	return 0;
}

